home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / gold / panelClass.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.6 KB  |  122 lines

  1. /*
  2.  * The original copyright owners of the accompanying source code files have
  3.  * agreed to place such code into the public domain.  Accordingly, anyone
  4.  * who receives or obtains a copy of such source code is freely entitled to
  5.  * reproduce, use and otherwise exploit such code (including the right to
  6.  * make derivative works), at his/her own risk and expense, without any
  7.  * obligation or liability to the original copyright owners.
  8.  *
  9.  * We would appreciate (but do not require) that the following message be
  10.  * included in any derivative works:
  11.  *
  12.  * "Portions of this program were developed by Peter Broadwell, Rob Myers
  13.  * and Robin Schaufler while working in Silicon Valley."
  14.  *
  15.  * The accompanying source code files and related documentation materials
  16.  * are distributed on an "AS IS" basis, without any warranties or
  17.  * guarantees of any kind.  All implied warranties, including the implied
  18.  * warranties of merchantability and of fitness for any particular purpose,
  19.  * are expressly disclaimed.
  20.  */
  21. #include "gl.h"
  22. #include "geom.h"
  23. #include "class.h"
  24. #include "classIds.h"
  25. #include "selectors.h"
  26. #include "mbox.h"
  27. #include "panel.h"
  28. #include "colors.h"
  29.  
  30. extern class instClass;
  31.  
  32. extern char *initPanel(), *drawPanel(), *freePanel();
  33. extern char *selectPanel(), *deselectPanel();
  34. extern char *bselPanel(), *cselPanel();
  35. extern char *eselPanel(), *oselPanel(), *nselPanel(), *kselPanel();
  36.  
  37. fcnTable panelTable[] = {
  38.     INIT,    initPanel,    /* initialize the control panel */
  39.     DRAW,    drawPanel,    /* render the panel description */
  40.     FREE,    freePanel,    /* gffree panel & his pals */
  41.     SELECT,    selectPanel,    /* process a selection on a panel   */
  42.     DESELECT,    deselectPanel,    /* process a deselection on a panel */
  43.     BEGINSELECT,bselPanel,    /* begin picking on a panel         */
  44.     CONTSELECT,    cselPanel,    /* continue picking on a panel      */
  45.     ENDSELECT,    eselPanel,    /* end picking on a panel           */
  46.     OLDSELECT,    oselPanel,    /* no longer picking on a panel     */
  47.     NEWSELECT,    nselPanel,    /* continue picking on a new panel  */
  48.     KILLSELECT,    kselPanel,    /* abort picking on current panel   */
  49.     RESET,    NULL,        /* opportunity to reset panel       */
  50.     DRAWTRACKER,NULL,
  51.     EOTABLE,
  52. };
  53.  
  54. class panelClass = {
  55.     &instClass,
  56.     panelTable,
  57.     sizeof(panel),
  58.     PANEL,
  59. };
  60.  
  61. panel panelTemplate = {
  62.             /*   inst        */
  63.     &panelClass,    /* myClass pointer    */
  64.     NULL,        /* classFunctions     */
  65.     0,            /* nFunctions        */
  66.             /*   mailbox        */
  67.     NULL,        /* subscribers          */
  68.     NULL,        /* subscribedTo         */
  69.                 /*   panel              */
  70.     NULL,        /* next            */
  71.     NULL,        /* kids            */
  72.     NULL,        /* dad            */
  73.     0,0,0,0,        /* area            */
  74.     NULL,        /* painter        */
  75. };
  76.  
  77.  
  78. fcnTable colorPanelTable[] = {
  79.     EOTABLE,
  80. };
  81.  
  82. class colorPanelClass = {
  83.     &panelClass,
  84.     colorPanelTable,
  85.     sizeof(colorPanel),
  86.     COLORPANEL,
  87. };
  88.  
  89. colorPanel colorPanelTemplate = {
  90.             /*   inst        */
  91.     &colorPanelClass,    /* myClass pointer    */
  92.     NULL,        /* classFunctions     */
  93.     0,            /* nFunctions        */
  94.             /*   mailbox        */
  95.     NULL,        /* subscribers          */
  96.     NULL,        /* subscribedTo         */
  97.                 /*   panel              */
  98.     NULL,        /* next            */
  99.     NULL,        /* kids            */
  100.     NULL,        /* dad            */
  101.     0,0,0,0,        /* area            */
  102.     NULL,        /* painter        */
  103. };
  104.  
  105. masterPanel mPanelTemplate = {
  106.             /*   inst        */
  107.     &panelClass,    /* myClass pointer    */
  108.     NULL,        /* classFunctions     */
  109.     0,            /* nFunctions        */
  110.             /*   mailbox        */
  111.     NULL,        /* subscribers          */
  112.     NULL,        /* subscribedTo         */
  113.                 /*   panel              */
  114.     NULL,        /* next            */
  115.     NULL,        /* kids            */
  116.     NULL,        /* dad            */
  117.     0,0,256,767,    /* area            */
  118.     NULL,        /* painter        */
  119.                 /*   masterPanel    */
  120.     0,0,        /* highwater        */
  121. };
  122.